import java.util.Scanner;

public class Jump {
    public static void main(String[] args) {
        Scanner scannern=new Scanner(System.in);
        int N=Integer.parseInt( scannern.nextLine());
        int road []=new int [N];

        if(N==0){
            System.out.println(0);
        }else
        {
            String line=scannern.nextLine();
            String x[]=line.split("");

            for (int i = 0; i < N; i++) {
                road[i]= Integer.parseInt(x[i]);
            }

            int d=road[0];//每次脚下的数
            int ii=0;//位置
            int row=0;//步数
            boolean change=false;
            while (ii!=N-1){
                change=false;

                for (int i = ii+1; i < N; i++) {
                    if(road[i]==d){
                        ii=i;
                        change=true;
                    }
                }

                if(change){
                    row++;
                }
                else{
                    ii++;
                    d=road[ii];
                    row++;
                }

            }

            System.out.println(row);
        }




    }
}
